home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / colorgrd.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  4.9 KB  |  138 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'ColorGrd.pas' rev: 3.00
  6.  
  7. #ifndef ColorGrdHPP
  8. #define ColorGrdHPP
  9. #include <Menus.hpp>
  10. #include <ExtCtrls.hpp>
  11. #include <Controls.hpp>
  12. #include <Forms.hpp>
  13. #include <Graphics.hpp>
  14. #include <Classes.hpp>
  15. #include <Messages.hpp>
  16. #include <Windows.hpp>
  17. #include <SysInit.hpp>
  18. #include <System.hpp>
  19.  
  20. //-- user supplied -----------------------------------------------------------
  21.  
  22. namespace Colorgrd
  23. {
  24. //-- type declarations -------------------------------------------------------
  25. enum TGridOrdering { go16x1, go8x2, go4x4, go2x8, go1x16 };
  26.  
  27. class DELPHICLASS TColorGrid;
  28. class PASCALIMPLEMENTATION TColorGrid : public Controls::TCustomControl 
  29. {
  30.     typedef Controls::TCustomControl inherited;
  31.     
  32. private:
  33.     tagPALETTEENTRY FPaletteEntries[20];
  34.     bool FClickEnablesColor;
  35.     int FForegroundIndex;
  36.     int FBackgroundIndex;
  37.     bool FForegroundEnabled;
  38.     bool FBackgroundEnabled;
  39.     int FSelection;
  40.     int FCellXSize;
  41.     int FCellYSize;
  42.     int FNumXSquares;
  43.     int FNumYSquares;
  44.     TGridOrdering FGridOrdering;
  45.     bool FHasFocus;
  46.     Classes::TNotifyEvent FOnChange;
  47.     TMouseButton FButton;
  48.     bool FButtonDown;
  49.     void __fastcall DrawSquare(int Which, bool ShowSelector);
  50.     void __fastcall DrawFgBg(void);
  51.     void __fastcall UpdateCellSizes(bool DoRepaint);
  52.     void __fastcall SetGridOrdering(TGridOrdering Value);
  53.     Graphics::TColor __fastcall GetForegroundColor(void);
  54.     Graphics::TColor __fastcall GetBackgroundColor(void);
  55.     void __fastcall SetForegroundIndex(int Value);
  56.     void __fastcall SetBackgroundIndex(int Value);
  57.     void __fastcall SetSelection(int Value);
  58.     void __fastcall EnableForeground(bool Value);
  59.     void __fastcall EnableBackground(bool Value);
  60.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  61.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  62.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  63.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  64.     HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
  65.     
  66. protected:
  67.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  68.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  69.         int Y);
  70.     DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
  71.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  72.         Y);
  73.     virtual void __fastcall CreateWnd(void);
  74.     virtual void __fastcall Paint(void);
  75.     DYNAMIC void __fastcall Change(void);
  76.     int __fastcall SquareFromPos(int X, int Y);
  77.     
  78. public:
  79.     __fastcall virtual TColorGrid(Classes::TComponent* AOwner);
  80.     int __fastcall ColorToIndex(Graphics::TColor AColor);
  81.     __property Graphics::TColor ForegroundColor = {read=GetForegroundColor, nodefault};
  82.     __property Graphics::TColor BackgroundColor = {read=GetBackgroundColor, nodefault};
  83.     
  84. __published:
  85.     __property bool ClickEnablesColor = {read=FClickEnablesColor, write=FClickEnablesColor, default=0};
  86.         
  87.     __property Ctl3D ;
  88.     __property DragCursor ;
  89.     __property DragMode ;
  90.     __property Enabled ;
  91.     __property TGridOrdering GridOrdering = {read=FGridOrdering, write=SetGridOrdering, default=2};
  92.     __property int ForegroundIndex = {read=FForegroundIndex, write=SetForegroundIndex, default=0};
  93.     __property int BackgroundIndex = {read=FBackgroundIndex, write=SetBackgroundIndex, default=0};
  94.     __property bool ForegroundEnabled = {read=FForegroundEnabled, write=EnableForeground, default=1};
  95.     __property bool BackgroundEnabled = {read=FBackgroundEnabled, write=EnableBackground, default=1};
  96.     __property Font ;
  97.     __property ParentCtl3D ;
  98.     __property ParentFont ;
  99.     __property ParentShowHint ;
  100.     __property PopupMenu ;
  101.     __property int Selection = {read=FSelection, write=SetSelection, default=0};
  102.     __property ShowHint ;
  103.     __property TabOrder ;
  104.     __property TabStop ;
  105.     __property Visible ;
  106.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  107.     __property OnClick ;
  108.     __property OnDragDrop ;
  109.     __property OnDragOver ;
  110.     __property OnEndDrag ;
  111.     __property OnEnter ;
  112.     __property OnExit ;
  113.     __property OnKeyDown ;
  114.     __property OnKeyPress ;
  115.     __property OnKeyUp ;
  116.     __property OnMouseDown ;
  117.     __property OnMouseMove ;
  118.     __property OnMouseUp ;
  119.     __property OnStartDrag ;
  120. public:
  121.     /* TCustomControl.Destroy */ __fastcall virtual ~TColorGrid(void) { }
  122.     
  123. public:
  124.     /* TWinControl.CreateParented */ __fastcall TColorGrid(HWND ParentWindow) : Controls::TCustomControl(
  125.         ParentWindow) { }
  126.     
  127. };
  128.  
  129. //-- var, const, procedure ---------------------------------------------------
  130. #define NumPaletteEntries (Byte)(20)
  131.  
  132. }    /* namespace Colorgrd */
  133. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  134. using namespace Colorgrd;
  135. #endif
  136. //-- end unit ----------------------------------------------------------------
  137. #endif    // ColorGrd
  138.